package com.atls.eduservice.controller;


import com.atls.commonutils.R;
import com.atls.eduservice.entity.EduComment;
import com.atls.eduservice.service.EduCommentService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 评论 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-04-05
 */
@RestController
@RequestMapping("/eduservice/comment")
@CrossOrigin
public class EduCommentController {

    @Autowired
    private EduCommentService commentService;

    //分页查询课程评论
    @GetMapping("getCommentInfo/{page}/{limit}")
    public R getCommentInfo(@PathVariable Long page,@PathVariable Long limit){
        Page<EduComment> commentPage=new Page<>(page,limit);
        Map<String,Object> map =commentService.getCommentList(commentPage);
        return R.ok().data(map);
    }
}

